package com.itwang.xiaohashu.auth.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * 登录类型
 */
@Getter
@AllArgsConstructor
public enum LoginTypeEnum {
    // 验证码
    VERIFICATION_CODE(1),
    // 密码
    PASSWORD(2);
    private final Integer value;


    public static LoginTypeEnum valueOf(Integer value){
        for (LoginTypeEnum loginTypeEnum : LoginTypeEnum.values()) {
            if(Objects.equals(value,loginTypeEnum.getValue())){
                return loginTypeEnum;
            }
        }
        return null;
    }
}
